import { createElement, HTMLAttributes, type FC } from 'react';
import classNames from 'classnames';

import { commentContentDefaultProps } from './defaultProps';
import type { CommentContentOptions } from './type';

export interface CommentContentProps extends CommentContentOptions, HTMLAttributes<HTMLDivElement> {}

const CommentContent: FC<CommentContentProps> = (props) => {
  const { className, children, forwardedRef, ...commentContentProps } = props;

  return createElement(
    'div',
    { ref: forwardedRef, className: classNames('content', className), ...commentContentProps },
    children,
  );
};

CommentContent.displayName = 'CommentContent';
CommentContent.defaultProps = commentContentDefaultProps;

export default CommentContent;
